package com.ruoyi.order.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单信息对象 wdm_order
 *
 * @author ruoyi
 * @date 2025-06-03
 */
@Data
public class Order {
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long orderId;

    /** 订单编号 */
    private String orderCode;

    /** 顾客ID */
    private Long guestId;

    /** 订单类型（1=商品订单） */
    private String orderType;

    /** 订单总金额 */
    private BigDecimal totalAmount;

    /** 主状态（0=待支付, 1=已支付, 2=待处理, 3=处理中, 4=已完成, 5=已取消） */
    private String masterStatus;

    /** 创建时间 */
    private Date createTime;

    /** 支付时间 */
    private Date payTime;

    /** 处理时间 */
    private Date processTime;

    /** 完成时间 */
    private Date finishTime;

    /** 状态（0=正常 1=停用） */
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 版本号（乐观锁） */
    private Long version;

    /** 更新时间 */
    private Date updateTime;

    /** 创建人 */
    private String createBy;

    /** 更新人 */
    private String updateBy;

    /** 备注 */
    private String remark;

    /** 订单扩展信息（JSON格式） */
    private String orderExtra;

    /** 用户ID */
    private Long userId;

    /** 过期时间 */
    private Date expireTime;

    /** 分销员ID */
    private Long distributorId;

    /** 核销码 */
    @Excel(name = "核销码")
    private String verificationCode;

    /** 核销状态（0待使用 1已使用） */
    @Excel(name = "核销状态", readConverterExp = "0=待使用,1=已使用")
    private String verificationStatus;

    /** 核销时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date verificationTime;

    /** 是否赠品（0否 1是） */
    private String isGifted;

    /** 赠品用户ID */
    private Long giftedUserId;

    /** 二维码图片地址 */
    @Excel(name = "二维码图片地址")
    private String qrCodeUrl;

    /** 二维码图片数据（Base64编码） */
    @Excel(name = "二维码图片数据")
    private String qrCodeData;

    /** 场景ID */
    private String sceneId;


    public void setOrderId(Long orderId)
    {
        this.orderId = orderId;
    }

    public Long getOrderId()
    {
        return orderId;
    }

    public void setOrderCode(String orderCode)
    {
        this.orderCode = orderCode;
    }

    public String getOrderCode()
    {
        return orderCode;
    }

    public void setGuestId(Long guestId)
    {
        this.guestId = guestId;
    }

    public Long getGuestId()
    {
        return guestId;
    }

    public void setOrderType(String orderType)
    {
        this.orderType = orderType;
    }

    public String getOrderType()
    {
        return orderType;
    }

    public void setTotalAmount(BigDecimal totalAmount)
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount()
    {
        return totalAmount;
    }

    public void setMasterStatus(String masterStatus)
    {
        this.masterStatus = masterStatus;
    }

    public String getMasterStatus()
    {
        return masterStatus;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public Date getCreateTime()
    {
        return createTime;
    }

    public void setPayTime(Date payTime)
    {
        this.payTime = payTime;
    }

    public Date getPayTime()
    {
        return payTime;
    }

    public void setProcessTime(Date processTime)
    {
        this.processTime = processTime;
    }

    public Date getProcessTime()
    {
        return processTime;
    }

    public void setFinishTime(Date finishTime)
    {
        this.finishTime = finishTime;
    }

    public Date getFinishTime()
    {
        return finishTime;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    public void setVersion(Long version)
    {
        this.version = version;
    }

    public Long getVersion()
    {
        return version;
    }

    public void setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime()
    {
        return updateTime;
    }

    public void setCreateBy(String createBy)
    {
        this.createBy = createBy;
    }

    public String getCreateBy()
    {
        return createBy;
    }

    public void setUpdateBy(String updateBy)
    {
        this.updateBy = updateBy;
    }

    public String getUpdateBy()
    {
        return updateBy;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setOrderExtra(String orderExtra)
    {
        this.orderExtra = orderExtra;
    }

    public String getOrderExtra()
    {
        return orderExtra;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setExpireTime(Date expireTime)
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime()
    {
        return expireTime;
    }

    public void setDistributorId(Long distributorId)
    {
        this.distributorId = distributorId;
    }

    public Long getDistributorId()
    {
        return distributorId;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public String getVerificationStatus() {
        return verificationStatus;
    }

    public void setVerificationStatus(String verificationStatus) {
        this.verificationStatus = verificationStatus;
    }

    public Date getVerificationTime() {
        return verificationTime;
    }

    public void setVerificationTime(Date verificationTime) {
        this.verificationTime = verificationTime;
    }

    public String getIsGifted() {
        return isGifted;
    }

    public void setIsGifted(String isGifted) {
        this.isGifted = isGifted;
    }

    public Long getGiftedUserId() {
        return giftedUserId;
    }

    public void setGiftedUserId(Long giftedUserId) {
        this.giftedUserId = giftedUserId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("orderCode", getOrderCode())
                .append("guestId", getGuestId())
                .append("orderType", getOrderType())
                .append("totalAmount", getTotalAmount())
                .append("masterStatus", getMasterStatus())
                .append("createTime", getCreateTime())
                .append("payTime", getPayTime())
                .append("processTime", getProcessTime())
                .append("finishTime", getFinishTime())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("version", getVersion())
                .append("updateTime", getUpdateTime())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .append("orderExtra", getOrderExtra())
                .append("userId", getUserId())
                .append("expireTime", getExpireTime())
                .append("distributorId", getDistributorId())
                .append("verificationCode", getVerificationCode())
                .append("verificationStatus", getVerificationStatus())
                .append("verificationTime", getVerificationTime())
                .append("isGifted", getIsGifted())
                .append("giftedUserId", getGiftedUserId())
                .toString();
    }
}
